package org.luxor.cloud.portal.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.luxor.cloud.portal.entity.OauthClientResourceRefEntity;
import org.luxor.cloud.portal.mapper.OauthClientResourceRefMapper;
import org.luxor.cloud.portal.service.IOauthClientResourceRefService;
import org.luxor.commons.core.utils.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 客户端与可访问资源的关联关系
 *
 * @author administrator @date 2020-10-29 14:27:54
 */
@Service("oauthClientResourceRefService")
public class OauthClientResourceRefServiceImpl extends ServiceImpl<OauthClientResourceRefMapper, OauthClientResourceRefEntity> implements IOauthClientResourceRefService {

    @Override
    public IPage<OauthClientResourceRefEntity> page(IPage<OauthClientResourceRefEntity> page, Map query) {
        OauthClientResourceRefEntity queryEntity = BeanUtils.toObject(OauthClientResourceRefEntity.class, query);
        return super.page(page, Wrappers.query(queryEntity));
    }
}
